
#import <AFNetworking/AFNetworking.h>

NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, SJNetworkingRequestType) {
    SJNetworkingRequestType_GET,
    SJNetworkingRequestType_POST,
};

typedef NS_ENUM(NSInteger, SJNetworkingStatus) {
    SJNetworkingStatus_NotReachable = 0,
    SJNetworkingStatus_ReachableViaWWAN = 1,
    SJNetworkingStatus_ReachableViaWiFi = 2
};

@interface SJNetworking : AFHTTPSessionManager
+ (instancetype)shared;
@property (nonatomic) BOOL debug; // default is Yes.
@property (nonatomic, readonly) SJNetworkingStatus networkingStatus;

- (NSURLSessionTask *)requestWithType:(SJNetworkingRequestType)type
                               URLStr:(NSString *)URLStr
                           parameters:(NSDictionary * __nullable)parameters
                           completion:(void(^ __nullable)(id __nullable response, NSError * __nullable error))block;
@end
NS_ASSUME_NONNULL_END
